home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 11 / Amiga Plus 11: Amiga Future.iso / rexx / blank_dsrx < prev    next >
Text File  |  1996-10-20  |  2KB  |  100 lines

  1. /* Allow commands to return results */
  2.  
  3. options results
  4.  
  5. /* On error, goto ERROR:. Comment out this line if you wish to */
  6. /* perform your own error checking. */
  7.  
  8. signal on error
  9.  
  10. 'PROJECT_LOCK'
  11.  
  12. /* BEGIN PROGRAM *************************************************/
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36. /* END PROGRAM ***************************************************/
  37.  
  38. 'PROJECT_UNLOCK'
  39.  
  40. exit
  41.  
  42. /* On ERROR */
  43.  
  44. ERROR:
  45.  
  46. 'PROJECT_UNLOCK'
  47.  
  48. /* If we get here, either an error occurred with the command's */
  49. /* execution or there was an error with the command itself. */
  50. /* In the former case, rc2 contains the error message and in */
  51. /* the latter, rc2 contains an error number. SIGL contains */
  52. /* the line number of the command which caused the jump */
  53. /* to ERROR: */
  54.  
  55. if datatype(rc2,'NUMERIC') == 1 then do
  56.     /* See if we can describe the error with a string */
  57.  
  58.     select
  59.         when rc2 == 103 then
  60.             err_string = "ERROR 103, "||,
  61.                 "out of memory at line "||SIGL
  62.         when rc2 == 114 then
  63.             err_string = "ERROR 114, "||,
  64.                 "bad command template at line "||SIGL
  65.         when rc2 == 115 then
  66.             err_string = "ERROR 115, "||,
  67.                 "bad number for /N argument at line "||SIGL
  68.         when rc2 == 116 then
  69.             err_string = "ERROR 116, "||,
  70.                 "required argument missing at line "||SIGL
  71.         when rc2 == 117 then
  72.             err_string = "ERROR 117, "||,
  73.                 "value after keywork missing at line "||SIGL
  74.         when rc2 == 118 then
  75.             err_string = "ERROR 118, "||,
  76.                 "wrong number of arguments at line "||SIGL
  77.         when rc2 == 119 then
  78.             err_string = "ERROR 119, "||,
  79.                 "unmatched quotes at line "||SIGL
  80.         when rc2 == 120 then
  81.             err_string = "ERROR 120, "||,
  82.                 "line too long at line "||SIGL
  83.         when rc2 == 236 then
  84.             err_string = "ERROR 236, "||,
  85.                 "unknown command at line "||SIGL
  86.         otherwise
  87.             err_string = "ERROR "||rc2||", at line "||SIGL
  88.         end
  89.     end
  90. else if rc2 == 'RC2' then do
  91.     err_string = "ERROR in command at line "||SIGL
  92.     end
  93. else do
  94.     err_string = rc2||", line "||SIGL
  95.     end
  96.  
  97. req_message TEXT '"'err_string'"'
  98.  
  99. exit
  100.